package com.icloud.common.database.enums;

import lombok.Getter;

@Getter
public enum JournalTypeEnum {
    RECHARGE("RECHARGE", "充值"),
    WITHDRAW("WITHDRAW", "总余额提现"),
    WITHDRAW_ABLE("WITHDRAW_ABLE", "可提现余额提现"),
    HOT("HOT", "热帖"),
    SEND_RED_PKT("SEND_RED_PKT", "派发红包"),
    RECV_RED_PKT("RECV_RED_PKT", "接收红包"),
    REFUND_RED_PKT("REFUND_RED_PKT", "红包退款"),
    REWARD("REWARD", "打赏"),
    GET_REWARD("GET_REWARD", "得到打赏奖励"),
    REGISTER_REWARD("REGISTER_REWARD", "注册奖励"),
    INVITE_REWARD("INVITE_REWARD", "邀请奖励"),
    PUBLISH_REWARD("PUBLISH_REWARD", "发布动态奖励"),
    ADMIN_OPERATE("ADMIN_OPERATE", "管理员操作");

    private final String code;
    private final String cn;

    JournalTypeEnum(String code, String cn){
        this.code = code;
        this.cn = cn;
    }

    public static JournalTypeEnum byCode(String code) {
        for (JournalTypeEnum e: JournalTypeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
